#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

void InsertSort(int* a, int n)
{
	for (int i = 0; i < n-1; i++)
	{
		int end = i;
		int tmp = a[end + 1];
		while (end >= 0)
		{
			if (tmp < a[end])
				a[end + 1] = a[end];
			else
				break;
			end--;
		}
		a[end + 1] = tmp;
	}
}

int main()
{
	int arr[10] = { 7,4,1,2,3,8,5,6,9,10 };
	InsertSort(arr, 10);
	return 0;
}